#pragma once
#ifndef EDITOR__PREREQUISITES__INCLUDED__HH__
#define EDITOR__PREREQUISITES__INCLUDED__HH__

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the EDITORLIBRARY_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// EDITORLIBRARY_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.

#include <LitPrerequisites.h>
#include <qstring.h>

#define TO_QT( std_str ) QString::fromStdString( std::string(std_str).c_str() )
#define FROM_QT( qt_str ) std::string( QString(qt_str).toStdString() )

#define TR_STD( cstr ) FROM_QT(tr(cstr))

#define EDITOR_VERSION_MAJOR PROJECT_VERSION_MAJOR
#define EDITOR_VERSION_MINOR PROJECT_VERSION_MINOR
#define EDITOR_VERSION_BUILD PROJECT_VERSION_BUILD
#define EDITOR_VERSION_REVISION PROJECT_VERSION_REVISION
#ifdef NDEBUG
#define EDITOR_VERSION_STRING PROJECT_VERSION_STRING
#else
#define EDITOR_VERSION_STRING PROJECT_VERSION_STRING" (DEBUG)"
#endif

#include <LitExceptions.h>
#include <LitFileSystem.h>
#include <qdatetime.h>

namespace Lit
{
	namespace Editor
	{
		class LIT_API Instance;
		class LIT_API Logger;
		class LIT_API StringMapConnecter;
		class LIT_API Dialog;
		class LIT_API FileDialog;
		
		namespace Lexer
		{
			struct LIT_API Word;
			struct LIT_API WordGroup;
			class LIT_API Keywords;
			class LIT_API MaterialKeywords;
		};
		
		class LIT_API MeshConverterException;
		class LIT_API MeshFormatException;

		class LIT_API MetaObject;
		struct LIT_API DragInfos;
		
		enum FontModifier
		{
			None = 0x0,
			StrikeOut = 1<<1,
			Underline = 1<<2,
			Italic = 1<<3,
			Bold = 1<<4,
			BoldItalic = Bold | Italic,
			BoldUnderline = Bold | Underline,
			ItalicStrikeOut = Italic | StrikeOut
		};

		struct LIT_API FontFamily;
		struct LIT_API Police;
		class LIT_API Project;
		class LIT_API SettingsDialog;
		class LIT_API RenderWidgetListener;
		class LIT_API _OgreWidget;
		class LIT_API RenderWidget;
		class LIT_API SettingsMap;
		class LIT_API SettingsTableWidget;
		class LIT_API SettingsTabWidget ;
		class LIT_API SettingsItemWidget;
		class LIT_API SettingsTextWidget;
		
		class LIT_API SettingsDoubleWidget;
		class LIT_API SettingsIntWidget;
		struct LIT_API TextListItems;
		class LIT_API SettingsBoolWidget;
		class LIT_API SettingsColorWidget;
		typedef RefPtr<Instance> InstancePtr;
		typedef RefPtr<Logger> LoggerPtr;

		struct LIT_API TimeStamp
		{
			std::string str;

			TimeStamp();
			TimeStamp( const TimeStamp& stp );
			TimeStamp( const std::string &sstr );
			~TimeStamp();
			
			TimeStamp& operator = ( const TimeStamp& rhs );
			TimeStamp& operator = ( const std::string& sstr );

			TimeStamp& operator += ( const TimeStamp& rhs );
			std::string& operator += ( const std::string& rhs );

			TimeStamp operator + ( const TimeStamp& rhs ) const;
			std::string operator + ( const std::string& rhs ) const;

			operator std::string() const{ return str; }
		};
		struct LIT_API DateStamp
		{
			std::string str;

			DateStamp();
			DateStamp( const DateStamp& stp );
			DateStamp( const std::string &sstr );
			~DateStamp();
			
			DateStamp& operator = ( const DateStamp& rhs );
			DateStamp& operator = ( const std::string& sstr );

			DateStamp& operator += ( const DateStamp& rhs );
			std::string& operator += ( const std::string& rhs );

			DateStamp operator + ( const DateStamp& rhs ) const;
			std::string operator + ( const std::string& rhs ) const ;

			operator std::string() const;
		};
		struct LIT_API System
		{
			static FilePath EditorPath();
			static FilePath EditorUserPath();
		};
	};
};

#endif